package com.xiaoyg.producer;

import com.xiaoyg.config.AnnotationConfiguration;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author xiaoyg
 * @Title: Producer
 * @ProjectName spring-rabbitmq-zhu
 * @Description: 生产者
 * @date 2018/12/711:17
 */
public class Producer {

    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AnnotationConfiguration.class);
        AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class);

        amqpTemplate.convertAndSend("Hello World");

        System.out.println("send : Hello World");

    }

}
